package com.example.ziru.mapper;

import com.example.ziru.entity.Tenant;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface TenantMapper {
    //用户登录验证
    @Select("select * from tenant where tPhone=#{tPhone}")
    Tenant selectBytPhone(String tPhone);

    //用户注册
    @Insert("insert IGNORE into tenant(tId,tNickname,tPhone, tPassword) values(#{tId},#{tNickname},#{tPhone},#{tPassword})")
    @Options(useGeneratedKeys=true, keyProperty="tId", keyColumn="tId")
    int reg(Tenant tenant);
}
